import {defineStore} from "pinia";

export const userUseStore= defineStore("user",{
    state:()=>{
      return{
          user:{
              id: '',
              avatar: '',
              nickname: '',
              account: '',
              mobile: '',
              token: ''
          },
          // 登录成功后跳转地址
          redirectUrl: '/'
      }
    },
    persist:true,
    actions:{
        setUser(obj){
        this.user=obj
        },
        setRedirectUrl (payload) {
            this.redirectUrl = payload
        }
    }
})
